<template>
  <LineChart />
  <LineChart2 />
</template>

<script setup>
import { ref, onMounted } from "vue";
import * as echarts from "echarts";
import LineChart from "./LineChartCom.vue";
import LineChart2 from "./LineChartCom2.vue";

const chartData = [
  { date: "2015", value: 100 },
  { date: "2016", value: 100 },
  { date: "2017", value: 10 },
  { date: "2018", value: 190 },
  { date: "2019", value: 100 },
  { date: "2020", value: 300 },
  { date: "2021", value: 120 },
  { date: "2022", value: 150 },
];

const chartOptions = {
  title: { text: "历年居住人数统计" },

  tooltip: {
    trigger: "axis",
  },
  xAxis: {
    type: "category",
    data: chartData.map((item) => item.date),
  },
  yAxis: {
    type: "value",
  },
};
let series = [
  {
    name: "人数",
    data: chartData.map((item) => item.value),
  },
];

let arr = series[0].data;
onMounted(() => {
  console.log(series);
});
</script>
